package com.bcu.cn.onlineexamsystem.studentmanage.mapper;

import com.bcu.cn.onlineexamsystem.studentmanage.entity.StudentExamInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface StudentExamInfoMapper {
    
    @Select("SELECT se.record_id, se.student_id, e.exam_id, e.exam_name, c.course_name, " +
            "e.exam_type, e.start_time, e.end_time, e.duration, e.total_score, " +
            "se.status, se.submit_time, se.total_score as student_score, u.user_name as teacher_name " +
            "FROM student_exams se " +
            "JOIN exams e ON se.exam_id = e.exam_id " +
            "JOIN courses c ON e.course_id = c.course_id " +
            "JOIN users u ON e.teacher_id = u.user_id " +
            "WHERE se.student_id = #{studentId} " +
            "ORDER BY e.start_time DESC")
    List<StudentExamInfo> getStudentExamInfoList(String studentId);
} 